package com.ruoyi.web.controller.iot.service.Impl;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.domain.iot.WatchData;
import com.ruoyi.web.controller.iot.bean.Device;
import com.ruoyi.web.controller.iot.service.DuDeomoService;
import com.ruoyi.web.controller.iot.utils.GPSTransToAMapUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

@Slf4j
@Service
public class DuDeomoServiceImpl implements DuDeomoService {

	private final static String gkdeKey = "cd701bb48aee4d974508334066d33c5c";
	private final static String LXYY_KEY = "a1c3946a137edb4f8b35131e23e40ccb";

	private static final String positionUrl = "http://apilocate.amap.com/position";
	private static final String LBS_URL = "https://tsapi.amap.com";

	private static final String SERVICE_ADD_PATH = "/v1/track/service/add";
	/**
	 * "data": {
	 * 		"name": "watch_gvji_service_demo",
	 * 		"sid": 1011275
	 *        }
	 */
	private static final String SERVICE_ID = "1011275";
	private static final String TID = "805876740";

	public static String Host = "https://tsapi.amap.com";

	public static String addpoints = "/v1/track/point/upload";
	public static String gettrack = "/v1/track/terminal/trsearch";

	@Override
	public Map<String,Object> getWatchLocation(String imei, String data){
		Map<String,Object> resultMap = new HashMap();
		List<String> listParams =new ArrayList<>();
		Arrays.stream(data.split(",")).forEach(s->{
			listParams.add(StringUtils.isBlank(s) ?"":s.toString());
		});
		String timeDate = listParams.get(1);
//		System.out.println((row++)+" UD: "+listParams.get(0));
//		System.out.println((row++)+" 日期: "+listParams.get(1));
//		System.out.println((row++)+" 时间: "+listParams.get(2));
//		System.out.println((row++)+" 有效 "+listParams.get(3));
//		System.out.println((row++)+(listParams.get(5).toString().equals("N")?"维度: ":"经度: ")+listParams.get(4));
//		System.out.println((row++)+(listParams.get(7).toString().equals("N")?"维度: ":"经度: ")+listParams.get(6));
//		System.out.println(" 速度: "+listParams.get(8));
//		System.out.println((row++)+" 方向: "+listParams.get(9));
//		System.out.println((row++)+" 海拔: "+listParams.get(10));
//		System.out.println((row++)+" 卫星个数: "+listParams.get(11));
//		System.out.println((row++)+" 信号强度: "+listParams.get(12));
//		System.out.println((row++)+" 电池电量: "+listParams.get(13)+"%");
//		System.out.println((row++)+" 计步数: "+listParams.get(14));
//		System.out.println((row++)+" 反转: "+listParams.get(15));
//		System.out.println((row++)+" 终端状态: "+listParams.get(16));
//		System.out.println((row++)+" 基站: "+listParams.get(17));
//		System.out.println((row++)+" 延时: "+listParams.get(18));
//		System.out.println((row++)+" MCC: "+listParams.get(19));
//		System.out.println((row++)+" MNC: "+listParams.get(20));
//		System.out.println((row++)+" lac: "+listParams.get(21));
//		System.out.println((row++)+" cellid: "+listParams.get(22));
//		System.out.println((row++)+" dbm: "+listParams.get(23));

		HashMap<String, Object> paramMap = new HashMap<>();
		paramMap.put("key", gkdeKey);
		paramMap.put("output", "json");
		paramMap.put("accesstype", "0");
		paramMap.put("cdma", "0");
		paramMap.put("network", "GSM");
		// 9618021536
		paramMap.put("imei", imei);
//        paramMap.put("mmac", "0:5c:c2:29:11:ed,-76,,|80:89:17:ec:62:a3,-80,,|70:85:c4:4f:f4:e1,-81,,");
		// mcc,mnc,lac,cellid,signal
		Integer signalDbm = Integer.parseInt(listParams.get(12))*2-113;
		StringJoiner sj = new StringJoiner(",");
		sj.add(listParams.get(19));
		sj.add(listParams.get(20));
		sj.add(listParams.get(21));
		sj.add(listParams.get(22));
		sj.add(signalDbm.toString());
		paramMap.put("bts", sj.toString());

		// {"infocode":"10000","result":{"city":"阜阳市","province":"安徽省","poi":"古泉新村","adcode":"341204","street":"光明路","desc":"安徽省 阜阳市 颍泉区 光明路 靠近古泉新村","country":"中国","type":"4","location":"115.8153274,32.9230824","road":"光明路","radius":"550","citycode":"1558"},"info":"OK","status":"1"}
		String location = listParams.get(6)+","+listParams.get(4);
		if (listParams.get(3).toString().equals("V")){
			String result3= HttpRequest.get(positionUrl).form(paramMap).timeout(2000).execute().body();
			JSONObject object = JSONObject.parseObject(result3);
			if (object.getString("status").equals("1")){
				location = object.getObject("result",JSONObject.class).getString("location");
			}else{
				location = "";
			}
		}
		if (StringUtils.isBlank(location)){
			return null;
		}
		// 转高德坐标
		List<String> plstr = Arrays.asList(location.split(","));
		GPSTransToAMapUtil.AMap  mapLocation = GPSTransToAMapUtil.transform(Double.parseDouble(plstr.get(0)),Double.parseDouble(plstr.get(1)));
		resultMap.put("location",(mapLocation.getLongitude()+","+mapLocation.getLatitude()));
//		resultMap.put("checkStatus",listParams.get(3));
//		resultMap.put("imei",imei);
//		resultMap.put("latitude",location.split(",")[1]);
//		resultMap.put("longitude",location.split(",")[0]);
		resultMap.put("speed",Double.parseDouble(listParams.get(8)));
		resultMap.put("direction",listParams.get(9));
		resultMap.put("height",listParams.get(10));
		resultMap.put("locatetime",getDeviceUnix(listParams.get(1),listParams.get(2)));
		JSONObject props = new JSONObject();
		props.put("locatetime",getDeviceUnix(listParams.get(1),listParams.get(2)));
		props.put("speed",listParams.get(8));
		props.put("height",listParams.get(10));
		resultMap.put("props",props.toJSONString());
		return resultMap;
	}

	/**
	 *
	 * @param list
	 * @param sid 轨迹ID
	 * @return
	 */
	@Override
	public Boolean addPointLbs(List<WatchData> list, String sid) {
		List<Map<String,Object>> dataMap = list.stream().filter(wm->wm.getMap() != null).map(WatchData::getMap).collect(Collectors.toList());
		addGjPoint(dataMap,sid);
		return true;
	}

	/**
	 * 查询轨迹下的纠偏点位 根据设备上报时间点范围查询 默认一天
	 * @param entity
	 * @param time 2023-12-12
	 * @return
	 */
	@Override
	public JSONObject getWatchPointLbs(String entity, String time) {
		// 计算时间
		String startTime = dateUnixTimeStamp( time+" 00:00:00","YYYY-MM-dd HH:mm:ss");
		String endTime = dateUnixTimeStamp( time+" 23:59:59","YYYY-MM-dd HH:mm:ss");
		Map<String,Object> paramMap = new HashMap<>();
		paramMap.put("key",LXYY_KEY); // 轨迹ID
		paramMap.put("sid",SERVICE_ID);
		paramMap.put("tid",TID); //终端: 一个终端下最多可创建500000条轨迹
		paramMap.put("trid",entity); // 轨迹ID
		paramMap.put("start_time",startTime);
		paramMap.put("end_time",endTime);
//		paramMap.put("correction","denoise=0,mapmatch=0,attribute=0,threshold=0,mode=driving");
		paramMap.put("correction","denoise=1,mapmatch=1,attribute=1,threshold=100,mode=driving");
		paramMap.put("recoup","1");
		paramMap.put("gap","100");
		paramMap.put("ispoints","1");
		paramMap.put("page","1");
		paramMap.put("pagesize","999");
		String result= HttpUtil.get(Host+gettrack,paramMap);
		log.info("轨迹纠偏 Raw results ：{}",result);
		return JSONObject.parseObject(result);
	}

	/**
	 *  时间戳一致 并且速度低于8km/h 由原始点位为主
	 *  速度高于8km/h 由纠偏后的点位为主
	 * @param oldPoint 原始点位
	 * @param locationList 纠正后的点位
	 * @return
	 */
	@Override
	public List<Device> correctionOfPointDetails(List<Device> oldPoint, List<Device> locationList) {
		log.info("correctionOfPointDetails 原始点位：{} 纠正点位: {} ",oldPoint.size(),locationList.size());
		// 速度低频的点位替换掉
		List<Device> newPoints = locationList.stream().map(d->{
			Optional<Device> device = oldPoint.stream().filter(o->((o.getLast_upload_at() == d.getLast_upload_at())  && (o.getSpeed() < 0.90))).findFirst();
			if (device.isPresent()){
				d.setLongitude(device.get().getLongitude());
				d.setLatitude(device.get().getLatitude());
			}
			return d;
		}).collect(Collectors.toList());
		// 纠正之后点位
		List<Device> speed =new ArrayList<>();
		for (int i = 0; i < oldPoint.size(); i++) {
			Device od = oldPoint.get(i);
			if (od.getSpeed() < 5.00 && (i>5) && (i+5< oldPoint.size()) ){
				Device preDevice = oldPoint.get(i-3);
				Device fixDevice = oldPoint.get(i+3);
				if ((preDevice.getSpeed() < 3.00) && (fixDevice.getSpeed() < 2.00)){
					speed.add(od); // 低速干活中
				}
			}
		}
//		speed = oldPoint.stream().map(od->(od.getSpeed() < 0.90)?od:null).collect(Collectors.toList());
		newPoints.addAll(speed);
		log.info("correctionOfPointDetails 纠偏后点位：{} {}",newPoints.size(),JSONObject.toJSONString(newPoints));
		return newPoints.stream().filter(s->null != s).sorted(Comparator.comparing(Device::getLast_upload_at).reversed()).collect(Collectors.toList());
	}


	private static String getDeviceUnix(String date, String time) {
		try {
			SimpleDateFormat sdf2 = new SimpleDateFormat("YYYY"); // 定义时间格式
			SimpleDateFormat sdf = new SimpleDateFormat("YY"); // 定义时间格式
			String timeStr = date;
			Date dateObj = sdf.parse(timeStr.substring(4,6));
			String timeDateStr = sdf2.format(dateObj)+"-"+timeStr.substring(2,4)+"-"+timeStr.substring(0,2)+" "+time.substring(0,2)+":"+time.substring(2,4)+":"+time.substring(4,6);
			return dateUnixTimeStamp(timeDateStr,"YYYY-MM-dd HH:mm:ss");
		}catch (Exception e){
			log.error("时间转换异常",e);
		}
		return null;
	}
	/**
	 * 日期格式字符串转换成时间戳
	 *
	 * @param dateStr 字符串日期
	 * @param format   如：yyyy-MM-dd HH:mm:ss
	 *
	 * @return
	 */
	public static String dateUnixTimeStamp(String dateStr, String format) {
		try {
			SimpleDateFormat sdf = new SimpleDateFormat(format);
			return String.valueOf(sdf.parse(dateStr).getTime());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "";
	}

	private static String UD_LTE = "UD_LTE,091223,124418,A,32.858073,N,115.8525152,E,10.18,52.4,0.0,16,100,61,0,0,00000000,1,0,460,0,22013,19707462,172,3,,18:f2:2c:89:34:3e,-77,,50:64:2b:1b:75:7,-83,,2a:6d:cd:6d:47:dc,-88,0.0]";

	/**
	 * 分段保存点位坐标
	 * @param map
	 * @param sid
	 * @return
	 */
	private static void addGjPoint(List<Map<String,Object>> map,String sid) {
		List<List<Map<String,Object>>> lis = ListUtils.partition(map, 99);
		lis.stream().forEach(lt->{
			Map<String,Object> paramMap = new HashMap<>();
			paramMap.put("key",LXYY_KEY);
			paramMap.put("sid",SERVICE_ID);
			paramMap.put("tid",TID); //终端: 一个终端下最多可创建500000条轨迹
			paramMap.put("trid",sid); // 轨迹ID
			paramMap.put("points",JSONObject.toJSONString(lt));
			String result3= HttpUtil.post(Host+addpoints,paramMap);
			log.info(" partition save add point result:{}",result3);
		});
	}


	/**
	 * key 	cd701bb48aee4d974508334066d33c5c
	 *  {"name":"watch_gj","sid":1011397}
	 */
	private static void addService() {
		Map<String,Object> paramMap = new HashMap<>();
		paramMap.put("key",gkdeKey);
		paramMap.put("name","watch_gj");
		paramMap.put("desc","用于轨迹纠偏查询");
		String result3= HttpUtil.post(LBS_URL+SERVICE_ADD_PATH,paramMap);
		System.out.println(result3);
	}

	public static final String list = "{\"location\":\"115.8617373,32.862369\",\"speed\":0.43,\"direction\":\"13.3\",\"height\":\"0.0\",\"locatetime\":\"1672581328000\"}\n" +
			"{\"location\":\"115.8598431,32.862784\",\"speed\":31.55,\"direction\":\"318.8\",\"height\":\"0.0\",\"locatetime\":\"1672502830000\"}\n" +
			"{\"location\":\"115.8567868,32.861097\",\"speed\":28.64,\"direction\":\"232.5\",\"height\":\"0.0\",\"locatetime\":\"1672502870000\"}\n" +
			"{\"location\":\"115.8531769,32.858508\",\"speed\":0.46,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672502931000\"}\n" +
			"{\"location\":\"115.8499033,32.856225\",\"speed\":0.5,\"direction\":\"201.6\",\"height\":\"0.0\",\"locatetime\":\"1672502990000\"}\n" +
			"{\"location\":\"115.8441170,32.852091\",\"speed\":19.64,\"direction\":\"230.3\",\"height\":\"0.0\",\"locatetime\":\"1672503105000\"}\n" +
			"{\"location\":\"115.8404042,32.849453\",\"speed\":40.91,\"direction\":\"229.3\",\"height\":\"0.0\",\"locatetime\":\"1672503157000\"}\n" +
			"{\"location\":\"115.8353705,32.845876\",\"speed\":11.94,\"direction\":\"232.2\",\"height\":\"0.0\",\"locatetime\":\"1672503216000\"}\n" +
			"{\"location\":\"115.8294634,32.841693\",\"speed\":57.21,\"direction\":\"231.2\",\"height\":\"0.0\",\"locatetime\":\"1672503279000\"}\n" +
			"{\"location\":\"115.8238232,32.843134\",\"speed\":51.15,\"direction\":\"320.6\",\"height\":\"0.0\",\"locatetime\":\"1672503334000\"}\n" +
			"{\"location\":\"115.8228741,32.844050\",\"speed\":0.39,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672503394000\"}\n" +
			"{\"location\":\"115.8121316,32.849864\",\"speed\":63.69,\"direction\":\"292.9\",\"height\":\"0.0\",\"locatetime\":\"1672503492000\"}\n" +
			"{\"location\":\"115.8072793,32.851337\",\"speed\":1.16,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672503541000\"}\n" +
			"{\"location\":\"115.8005962,32.852236\",\"speed\":56.44,\"direction\":\"278.6\",\"height\":\"0.0\",\"locatetime\":\"1672503601000\"}\n" +
			"{\"location\":\"115.7974409,32.852682\",\"speed\":0.24,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672503662000\"}\n" +
			"{\"location\":\"115.7882228,32.853946\",\"speed\":24.28,\"direction\":\"283.5\",\"height\":\"0.0\",\"locatetime\":\"1672503779000\"}\n" +
			"{\"location\":\"115.7882118,32.859168\",\"speed\":49.07,\"direction\":\"12.0\",\"height\":\"0.0\",\"locatetime\":\"1672503843000\"}\n" +
			"{\"location\":\"115.7872196,32.862909\",\"speed\":44.57,\"direction\":\"278.5\",\"height\":\"0.0\",\"locatetime\":\"1672503901000\"}\n" +
			"{\"location\":\"115.7856732,32.864272\",\"speed\":0.32,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672503964000\"}\n" +
			"{\"location\":\"115.7853043,32.864913\",\"speed\":2.05,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504024000\"}\n" +
			"{\"location\":\"115.7843293,32.865181\",\"speed\":4.16,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504090000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504171000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504230000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504289000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504348000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504427000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504486000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504545000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504604000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504663000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672504722000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505671000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505730000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505789000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505848000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505907000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672505966000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672506025000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672506085000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672506144000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672506473000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672506532000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672507711000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672507770000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672507829000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672508538000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672508597000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672509624000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672509843000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672509902000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672509961000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510020000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510229000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510288000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510347000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510406000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510465000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510524000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510663000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510722000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510781000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510840000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510899000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672510958000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511017000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511076000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511135000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511194000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511253000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672511312000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516501000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516560000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516619000\"}\n" +
			"{\"location\":\"115.7873416,32.8633898\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516678000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516737000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516796000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516855000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516915000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672516974000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672517033000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672517092000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672517151000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672523180000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672523239000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672523298000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672523357000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672523416000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672524864000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527623000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527683000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527742000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527801000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527860000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527919000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672527978000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672528037000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672528276000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672528335000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672528394000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672528453000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672529542000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672529601000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672529660000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672529719000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532698000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532757000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532816000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532875000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532934000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672532993000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533052000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533111000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533170000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533229000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533348000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533407000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672533466000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534065000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534124000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534183000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534242000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534301000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672534360000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672535359000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672535418000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672535477000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672536706000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672536765000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672536824000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672536883000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672536972000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537031000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537090000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537149000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537208000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537267000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537326000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537385000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672537444000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538564000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538623000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538682000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538741000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538800000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538859000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538918000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672538977000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672539036000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672539765000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672539824000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672539883000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672539942000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672540181000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672540240000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541239000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541298000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541357000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541416000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541475000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541684000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541743000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541802000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541891000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672541950000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542169000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542228000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542287000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542346000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542405000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542464000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542523000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542582000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542641000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672542700000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672543589000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672543648000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672544617000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672544676000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545025000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545364000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545423000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545482000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545541000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545600000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545660000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545719000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545778000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545837000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545896000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672545955000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546014000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546073000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546132000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546191000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546250000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546309000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546368000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546427000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546486000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546545000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546724000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546783000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546842000\"}\n" +
			"{\"location\":\"115.7893026,32.8633274\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546901000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672546960000\"}\n" +
			"{\"location\":\"115.7873055,32.860322\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547019000\"}\n" +
			"{\"location\":\"115.7912519,32.8639499\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547078000\"}\n" +
			"{\"location\":\"115.7856127,32.864333\",\"speed\":1.46,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547132000\"}\n" +
			"{\"location\":\"115.7857074,32.864272\",\"speed\":0.65,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547160000\"}\n" +
			"{\"location\":\"115.7856429,32.864363\",\"speed\":1.79,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547221000\"}\n" +
			"{\"location\":\"115.7876483,32.862749\",\"speed\":40.89,\"direction\":\"99.3\",\"height\":\"0.0\",\"locatetime\":\"1672547307000\"}\n" +
			"{\"location\":\"115.7882731,32.860011\",\"speed\":1.12,\"direction\":\"175.1\",\"height\":\"0.0\",\"locatetime\":\"1672547354000\"}\n" +
			"{\"location\":\"115.7878272,32.858362\",\"speed\":42.62,\"direction\":\"191.6\",\"height\":\"0.0\",\"locatetime\":\"1672547425000\"}\n" +
			"{\"location\":\"115.7869250,32.853898\",\"speed\":19.59,\"direction\":\"150.5\",\"height\":\"0.0\",\"locatetime\":\"1672547482000\"}\n" +
			"{\"location\":\"115.7955465,32.852674\",\"speed\":45.02,\"direction\":\"97.7\",\"height\":\"0.0\",\"locatetime\":\"1672547542000\"}\n" +
			"{\"location\":\"115.7963501,32.852567\",\"speed\":0.73,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672547589000\"}\n" +
			"{\"location\":\"115.8087113,32.850971\",\"speed\":53.71,\"direction\":\"106.6\",\"height\":\"0.0\",\"locatetime\":\"1672547738000\"}\n" +
			"{\"location\":\"115.8164075,32.848205\",\"speed\":60.55,\"direction\":\"113.8\",\"height\":\"0.0\",\"locatetime\":\"1672547787000\"}\n" +
			"{\"location\":\"115.8229706,32.843746\",\"speed\":46.76,\"direction\":\"138.5\",\"height\":\"0.0\",\"locatetime\":\"1672547845000\"}\n" +
			"{\"location\":\"115.8278545,32.840540\",\"speed\":43.28,\"direction\":\"46.7\",\"height\":\"0.0\",\"locatetime\":\"1672547907000\"}\n" +
			"{\"location\":\"115.8316558,32.843166\",\"speed\":11.81,\"direction\":\"51.3\",\"height\":\"0.0\",\"locatetime\":\"1672547961000\"}\n" +
			"{\"location\":\"115.8364817,32.846610\",\"speed\":44.08,\"direction\":\"50.8\",\"height\":\"0.0\",\"locatetime\":\"1672548021000\"}\n" +
			"{\"location\":\"115.8383437,32.847955\",\"speed\":28.21,\"direction\":\"52.5\",\"height\":\"0.0\",\"locatetime\":\"1672548082000\"}\n" +
			"{\"location\":\"115.8414579,32.850163\",\"speed\":37.37,\"direction\":\"47.1\",\"height\":\"0.0\",\"locatetime\":\"1672548140000\"}\n" +
			"{\"location\":\"115.8473137,32.854426\",\"speed\":43.65,\"direction\":\"47.5\",\"height\":\"0.0\",\"locatetime\":\"1672548199000\"}\n" +
			"{\"location\":\"115.8525152,32.858073\",\"speed\":10.18,\"direction\":\"52.4\",\"height\":\"0.0\",\"locatetime\":\"1672548258000\"}\n" +
			"{\"location\":\"115.8552988,32.859940\",\"speed\":16.58,\"direction\":\"49.8\",\"height\":\"0.0\",\"locatetime\":\"1672548318000\"}\n" +
			"{\"location\":\"115.8582832,32.862012\",\"speed\":20.55,\"direction\":\"53.8\",\"height\":\"0.0\",\"locatetime\":\"1672548378000\"}\n" +
			"{\"location\":\"115.8605333,32.862386\",\"speed\":11.3,\"direction\":\"51.4\",\"height\":\"0.0\",\"locatetime\":\"1672548437000\"}\n" +
			"{\"location\":\"115.8617364,32.862322\",\"speed\":3.46,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548498000\"}\n" +
			"{\"location\":\"115.8676006,32.8597195\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548584000\"}\n" +
			"{\"location\":\"115.8668528,32.8612082\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548643000\"}\n" +
			"{\"location\":\"115.8676885,32.8611523\",\"speed\":0.0,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548702000\"}\n" +
			"{\"location\":\"115.8617537,32.862102\",\"speed\":0.91,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548759000\"}\n" +
			"{\"location\":\"115.8617261,32.862125\",\"speed\":0.32,\"direction\":\"0.0\",\"height\":\"0.0\",\"locatetime\":\"1672548779000\"}";

	public static void main(String[] args) throws ParseException {
		List<String> locaList = Arrays.asList(list.split("\n"));
		System.out.println(locaList.size());
		List<JSONObject> speedData = new ArrayList<>();
		Boolean addType = true;
		for (int i = 0; i < locaList.size(); i++) {
			JSONObject d = JSONObject.parseObject(locaList.get(i));
//			if (d.getDouble("speed").equals(0.0)){
//				if (addType){
////					speedData.add(d);
//					addType = false;
//				}
//			}else{
//				if (!addType){
//					speedData.add(JSONObject.parseObject(locaList.get((i-1))));
//				}
//				speedData.add(d);
//			}
			speedData.add(d);
		}
		System.out.println(JSONObject.toJSONString(speedData));
		List<double[]> pointLocation = speedData.stream().map(js->{
			List<String> plstr = Arrays.asList(js.getString("location").split(","));
//			double[] pl = {Double.parseDouble(plstr.get(0)),Double.parseDouble(plstr.get(1))};
			GPSTransToAMapUtil.AMap  mapLocation = GPSTransToAMapUtil.transform(Double.parseDouble(plstr.get(0)),Double.parseDouble(plstr.get(1)));
			double[] pl = {mapLocation.getLongitude(),mapLocation.getLatitude()};
			return pl;
		}).collect(Collectors.toList());
		System.out.println(JSONObject.toJSONString(pointLocation));
	}





}
